package com.atguigu.dga230301.governance.demo;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexpDemo {
    public static void main(String[] args) {
        String email = "ZhangJy_0819@126abcdefg123456a.cn";
        Pattern pattern = Pattern.compile("^\\w+@\\w{1,16}\\.(cn|com|org)$");
        Matcher matcher = pattern.matcher(email);

        System.out.println(pattern.toString());

        System.out.println("匹配结果："+matcher.matches());
    }
}
